package com.qfmy.web.app.controller.conmon;

import com.qfmy.common.result.Result;
import com.qfmy.model.vo.common.UserSignRecordVo;
import com.qfmy.web.app.service.conmon.UserSignRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.math.BigDecimal;

/**
 * @author 清风明月
 * @Package com.qfmy.web.app.controller.conmon
 * @date 2025/11/6
 * @description 用户签到表
 */
@RestController
@RequestMapping("/app/userSignRecord")
@SuppressWarnings("all")
public class UserSignRecordController {

    /**
     * 注入service
     */
    @Autowired
    private UserSignRecordService userSignRecordService;

    /**
     * 进行签到
     */
    @RequestMapping("/signIn")
    public Result signIn(@RequestParam BigDecimal reward, @RequestParam Integer day) {
        userSignRecordService.signIn(reward,day);
        return Result.ok("签到成功");
    }

    /**
     * 获取用户的签到记录
     */
    @RequestMapping("/getUserSignRecord")
    public Result<UserSignRecordVo> getUserSignRecord() {
        UserSignRecordVo userSignRecordVo = userSignRecordService.getUserSigIn();
        return Result.ok(userSignRecordVo);
    }


}
